import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld';
const aboutPage = () => import('@/components/about');
const person1Page = () => import(/* webpackChunkName: "person" */'@/components/person1');
const person2Page = () => import(/* webpackChunkName: "person" */'@/components/person2');
const dynamicPage = (page) => () => import('@/components/'+page);
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },{
      path:'/about',
      component: aboutPage
    },{
      path:'/person1',
      component: person1Page
    },{
      path:'/person2',
      component: person2Page
    },
    {
      path:'/dynamic',
      component:dynamicPage('dynamic')
    },
    {
      path:'/freeze',
      component:dynamicPage('freeze')
    },
    {
      path:'/normalize',
      component:dynamicPage('normalize')
    }
  ]
})
